package org.stu.tp.dao;

import java.util.List;

import org.hibernate.Session;
import org.stu.tp.dto.User;
import org.stu.tp.util.HibernateUtil;

public class UserDao {
	@SuppressWarnings("unchecked")
	public static User getUser(String recordName){
		User user=new User();
		Session session = HibernateUtil.currentSession();
		List <User> userList=session.createSQLQuery("select * from user where RecordName="+"'"+recordName+"'").addEntity(User.class).list();
		user=userList.get(0);
		HibernateUtil.closeSession();
		return user;
	}
	
}
